package me.flyray.crm.core.feignserver;

import javax.validation.Valid;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.github.wxiaoqi.security.biz.common.crm.request.IntoAccountRequest;
import com.github.wxiaoqi.security.common.msg.BaseApiResponse;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import me.flyray.crm.core.biz.CommonIntoAccountBizTcc;

/***
 * 入账相关的接口
 * */
@Api(tags="入账相关的接口")
@Controller
@RequestMapping("feign")
public class FeignCustomerIntoAccountTcc {
	
	@Autowired
	private CommonIntoAccountBizTcc commonIntoAccountBizTcc;
	
	/**
	 * 个人或者商户入账
	 * @param 
	 * @return
	 */
	@ApiOperation("个人或者商户入账相关的接口")
	@RequestMapping(value = "/intoAccountTcc",method = RequestMethod.POST)
    @ResponseBody
    public BaseApiResponse intoAccount(@RequestBody @Valid IntoAccountRequest intoAccountRequest) {
		BaseApiResponse response = commonIntoAccountBizTcc.intoAccount(intoAccountRequest);
		return response;
    }
	
	
	/**
	 * 商户余额入账
	 * @param intoAccountRequest
	 * @return
	 */
	@ApiOperation("商户余额账户入账接口")
	@RequestMapping(value = "/balAccountInto",method = RequestMethod.POST)
    @ResponseBody
    public BaseApiResponse balAccountInto(@RequestBody @Valid IntoAccountRequest intoAccountRequest){
		BaseApiResponse response = commonIntoAccountBizTcc.balAccountInto(intoAccountRequest);
		return response;
    }
	
	
	/**
	 * 保存账户流水
	 * @param intoAccountRequest
	 * @return
	 * @throws Exception 
	 */
	@ApiOperation("账户流水接口")
	@RequestMapping(value = "/accountJournal",method = RequestMethod.POST)
    @ResponseBody
    public BaseApiResponse accountJournal(@RequestBody @Valid IntoAccountRequest intoAccountRequest) {
		BaseApiResponse response = commonIntoAccountBizTcc.accountJournal(intoAccountRequest);
		return response;
    }
	
	
	/**
	 * 查询账户信息
	 * @param intoAccountRequest
	 * @return
	 */
	@ApiOperation("查询账户信息")
	@RequestMapping(value = "/accountInfoQuery",method = RequestMethod.POST)
    @ResponseBody
    public BaseApiResponse accountInfoQuery(@RequestBody @Valid IntoAccountRequest intoAccountRequest){
		BaseApiResponse response = commonIntoAccountBizTcc.accountInfoQuery(intoAccountRequest);
		return response;
    }
	
	
	/**
	 * 創建賬戶
	 * @param intoAccountRequest
	 * @return
	 * @throws Exception 
	 */
	@ApiOperation("創建賬戶")
	@RequestMapping(value = "/createAccount",method = RequestMethod.POST)
    @ResponseBody
    public BaseApiResponse createAccount(@RequestBody @Valid IntoAccountRequest intoAccountRequest) {
		BaseApiResponse response = commonIntoAccountBizTcc.createAccount(intoAccountRequest);
		return response;
    }
	
}
